<style lang="less">
    @import "../node_modules/iview/src/styles/index.less";
    @import "../src/assets/mytheme/index.less";
</style>
<style lang="sass">
    @import "../src/assets/sass/mixins.scss";
    @import "../src/assets/sass/base.scss";
</style>
<template>
  <div id="app">
      <div :class="{'app-inner': !loginStatus, 'loginBox': loginStatus}">
          <TopHeader  v-if="!loginStatus"></TopHeader>
          <div class="transition" :class="{'mainContentWrap': !loginStatus, 'loginBox': loginStatus, 'shrinkMainWrap': Headershrink}">
            <LeftNav :navDatas="navDatas" v-if="!loginStatus"></LeftNav>
            <router-view :loginStatus="loginStatus"></router-view>
          </div>
      </div>
  </div>
</template>

<script>
    import $ from 'jquery'
    import VueLocalStorage  from 'vue-localstorage'
    import Cookies from 'js-cookie'
    import store from './store/index';
    import { mapGetters } from 'vuex'
    import user from './utils/user'
    import GLOBAL_NAV_DATAS from './utils/navDatas'
    export default {
      store,
      computed:{
           ...mapGetters(['Headershrink'])
       },
      name: 'app',
      components:{
        "TopHeader":require('./layout/Header'),
        "LeftNav":require('./layout/LeftNav'),
        // "Login":require('./Page/Login/Login'),
      },
      data: function (){ 
      	return {
          loginStatus: this.$route.path.indexOf('login') > -1 ? true : false,
          navDatas:   GLOBAL_NAV_DATAS,
      	}
      }, 
      methods: { 
        refresh: function(){
          let vm = this;
        },  
      },
      created() {
          let vm = this;
          let token = user.getToken();  
          if (!token) { 
           vm.loginStatus = true;
          }else {   
            vm.loginStatus = false;
          } 
      },
    }
</script>

<style>
</style>
